package utils.test;

import net.HttpRequest;
import net.sf.json.JSONObject;

public class StartTaskByModel {
    public static void main(String[] args) {
        String aa = "{\n" +
                "    \"fatherTaskId\":\"11\",\n" +
                "    \"modelId\": \"207\",\n" +
                "    \"taskNumber\": \"4\",\n" +
                "    \"params\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"-p0\",\n" +
                "                        \"paramValue\": \"11\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            }\n" +
                "        ],\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"-p0\",\n" +
                "                        \"paramValue\": \"22\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"inputs\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"blockName\": \"01:new_test2\",\n" +
                "                \"inputName\": \"-i0\",\n" +
                "                \"frontOutput\": {\n" +
                "                    \"frontOutputName\": \"a/a_b/a_b_b.jpg\",\n" +
                "                    \"blockId\": \"uiStart_1\",\n" +
                "                    \"dataId\": \"\"\n" +
                "                }\n" +
                "            }\n" +
                "        ],\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"blockName\": \"01:new_test2\",\n" +
                "                \"inputName\": \"-i0\",\n" +
                "                \"frontOutput\": {\n" +
                "                    \"frontOutputName\": \"bbbbb/a_b/a_b_b.jpg\",\n" +
                "                    \"blockId\": \"uiStart_1\",\n" +
                "                    \"dataId\": \"\"\n" +
                "                }\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"outputs\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"blockName\": \"05:generic1\",\n" +
                "                \"outputName\": \"-o0\",\n" +
                "                \"outputAddress\": \"\",\n" +
                "                \"outputValue\": \"11.2\"\n" +
                "            }\n" +
                "        ],\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"blockName\": \"05:generic1\",\n" +
                "                \"outputName\": \"-o0\",\n" +
                "                \"outputAddress\": \"\",\n" +
                "                \"outputValue\": \"11.2\"\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"other说明\":\"优先级和并行策略\",\n" +
                "    \"other\": [\n" +
                "        {\n" +
                "            \"Priority\": \"50\"\n" +
                "        },\n" +
                "        {\n" +
                "            \"Priority\": \"80\"\n" +
                "        }\n" +
                "    ]" +
                "}";

        String bb = "{\n" +
                "        \"fatherTaskId\": \"121\",\n" +
                "        \"modelId\": \"241\",\n" +
                "        \"taskNumber\": \"2\",\n" +
                "        \"params\": [\n" +
                "            [\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"param\": [\n" +
                "                        {\n" +
                "                            \"paramName\": \"-p0\",\n" +
                "                            \"paramValue\": \"1\"\n" +
                "                        },\n" +
                "                        {\n" +
                "                            \"paramName\": \"-p1\",\n" +
                "                            \"paramValue\": \"1\"\n" +
                "                        }\n" +
                "                    ]\n" +
                "                }\n" +
                "            ],\n" +
                "            [\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"param\": [\n" +
                "                        {\n" +
                "                            \"paramName\": \"-p0\",\n" +
                "                            \"paramValue\": \"1\"\n" +
                "                        },\n" +
                "                        {\n" +
                "                            \"paramName\": \"-p1\",\n" +
                "                            \"paramValue\": \"1\"\n" +
                "                        }\n" +
                "                    ]\n" +
                "                }\n" +
                "            ]\n" +
                "        ],\n" +
                "        \"inputs\": [\n" +
                "            [\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"blockName\": \"test4\",\n" +
                "                    \"inputName\": \"-i0\",\n" +
                "                    \"frontOutput\": {\n" +
                "                        \"frontOutputName\": \"b/b_a/b_a_b.jpg\",\n" +
                "                        \"blockId\": \"uiStart_1\",\n" +
                "                        \"dataId\": \"\"\n" +
                "                    }\n" +
                "                },\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"blockName\": \"test4\",\n" +
                "                    \"inputName\": \"-i1\",\n" +
                "                    \"frontOutput\": {\n" +
                "                        \"frontOutputName\": \"b/b_a/b_a_a.jpg\",\n" +
                "                        \"blockId\": \"uiStart_1\",\n" +
                "                        \"dataId\": \"\"\n" +
                "                    }\n" +
                "                }\n" +
                "            ],\n" +
                "            [\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"blockName\": \"test4\",\n" +
                "                    \"inputName\": \"-i0\",\n" +
                "                    \"frontOutput\": {\n" +
                "                        \"frontOutputName\": \"b/b_a/b_a_b.jpg\",\n" +
                "                        \"blockId\": \"uiStart_1\",\n" +
                "                        \"dataId\": \"\"\n" +
                "                    }\n" +
                "                },\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"blockName\": \"test4\",\n" +
                "                    \"inputName\": \"-i1\",\n" +
                "                    \"frontOutput\": {\n" +
                "                        \"frontOutputName\": \"b/b_a/b_a_a.jpg\",\n" +
                "                        \"blockId\": \"uiStart_1\",\n" +
                "                        \"dataId\": \"\"\n" +
                "                    }\n" +
                "                }\n" +
                "            ]\n" +
                "        ],\n" +
                "        \"outputs\": [\n" +
                "            [\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"blockName\": \"test4\",\n" +
                "                    \"outputName\": \"-o0\",\n" +
                "                    \"outputAddress\": \"\",\n" +
                "                    \"outputValue\": \".pig\"\n" +
                "                },\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"blockName\": \"test4\",\n" +
                "                    \"outputName\": \"-o1\",\n" +
                "                    \"outputAddress\": \"\",\n" +
                "                    \"outputValue\": \".opt\"\n" +
                "                }\n" +
                "            ],\n" +
                "            [\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"blockName\": \"test4\",\n" +
                "                    \"outputName\": \"-o0\",\n" +
                "                    \"outputAddress\": \"\",\n" +
                "                    \"outputValue\": \".pig\"\n" +
                "                },\n" +
                "                {\n" +
                "                    \"blockId\": \"uiAlgorithm_1\",\n" +
                "                    \"blockName\": \"test4\",\n" +
                "                    \"outputName\": \"-o1\",\n" +
                "                    \"outputAddress\": \"\",\n" +
                "                    \"outputValue\": \".opt\"\n" +
                "                }\n" +
                "            ]\n" +
                "        ],\n" +
                "        \"other说明\": \"优先级和并行策略\",\n" +
                "        \"other\": [\n" +
                "            {\n" +
                "                \"Priority\": \"50\",\n" +
                "                \"ParallelStrategy\": \"-ut\"\n" +
                "            }\n" +
                "        ]\n" +
                "    }";
        String ccc = "{\n" +
                "    \"fatherTaskId\": \"121\",\n" +
                "    \"modelId\": \"242\",\n" +
                "    \"taskNumber\": \"1\",\n" +
                "    \"params\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"p1\",\n" +
                "                        \"paramValue\": \"1\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"paramName\": \"p2\",\n" +
                "                        \"paramValue\": \"1\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"inputs\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"blockName\": \"test5\",\n" +
                "                \"inputName\": \"i1\",\n" +
                "                \"frontOutput\": {\n" +
                "                    \"frontOutputName\": \"b/b_a/b_a_b.jpg\",\n" +
                "                    \"blockId\": \"uiStart_1\",\n" +
                "                    \"dataId\": \"\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"blockName\": \"test5\",\n" +
                "                \"inputName\": \"i2\",\n" +
                "                \"frontOutput\": {\n" +
                "                    \"frontOutputName\": \"b/b_a/b_a_a.jpg\",\n" +
                "                    \"blockId\": \"uiStart_1\",\n" +
                "                    \"dataId\": \"\"\n" +
                "                }\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"outputs\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"blockName\": \"test5\",\n" +
                "                \"outputName\": \"o1\",\n" +
                "                \"outputAddress\": \"\",\n" +
                "                \"outputValue\": \".pig\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"blockName\": \"test5\",\n" +
                "                \"outputName\": \"o2\",\n" +
                "                \"outputAddress\": \"\",\n" +
                "                \"outputValue\": \".opt\"\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"other\": [\n" +
                "        {\n" +
                "            \"Priority\": \"50\",\n" +
                "            \"ParallelStrategy\": \"-ut\"\n" +
                "        }\n" +
                "    ]\n" +
                "}";
        String dd = "{\n" +
                "    \"fatherTaskId\": \"121\",\n" +
                "    \"modelId\": \"243\",\n" +
                "    \"taskNumber\": \"1\",\n" +
                "    \"params\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"p0\",\n" +
                "                        \"paramValue\": \"1\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"paramName\": \"p1\",\n" +
                "                        \"paramValue\": \"1\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"inputs\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"inputName\": \"-i0\",\n" +
                "                \"frontOutput\": {\n" +
                "                    \"frontOutputName\": \"b/b_b/b_b_b.jpg\",\n" +
                "                    \"blockId\": \"uiStart_1\",\n" +
                "                    \"dataId\": \"\"\n" +
                "                }\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"inputName\": \"-i1\",\n" +
                "                \"frontOutput\": {\n" +
                "                    \"frontOutputName\": \"b/b_b/b_b_b.jpg\",\n" +
                "                    \"blockId\": \"uiStart_1\",\n" +
                "                    \"dataId\": \"\"\n" +
                "                }\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"outputs\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"outputName\": \"-o0\",\n" +
                "                \"outputAddress\": \"\",\n" +
                "                \"outputValue\": \"2111.2\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"outputName\": \"-o1\",\n" +
                "                \"outputAddress\": \"\",\n" +
                "                \"outputValue\": \"22222.1\"\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"other\": [\n" +
                "        {\n" +
                "            \"Priority\": \"50\",\n" +
                "            \"ParallelStrategy\": \"-ut\"\n" +
                "        }\n" +
                "    ]\n" +
                "}";
        String ee = "{\n" +
                "    \"fatherTaskId\": \"121\",\n" +
                "    \"modelId\": \"250\",\n" +
                "    \"taskNumber\": \"2\",\n" +
                "    \"params\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"p1\",\n" +
                "                        \"paramValue\": \"1_1_1\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"paramName\": \"p2\",\n" +
                "                        \"paramValue\": \"1_1_2\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_2\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"p1\",\n" +
                "                        \"paramValue\": \"1_2_1\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"paramName\": \"p2\",\n" +
                "                        \"paramValue\": \"1_2_2\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_3\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"-p0\",\n" +
                "                        \"paramValue\": \"1_2_1\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            }\n" +
                "        ],\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_1\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"p1\",\n" +
                "                        \"paramValue\": \"1_1_1\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"paramName\": \"p2\",\n" +
                "                        \"paramValue\": \"1_1_2\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_2\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"p1\",\n" +
                "                        \"paramValue\": \"1_2_1\"\n" +
                "                    },\n" +
                "                    {\n" +
                "                        \"paramName\": \"p2\",\n" +
                "                        \"paramValue\": \"1_2_2\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_3\",\n" +
                "                \"param\": [\n" +
                "                    {\n" +
                "                        \"paramName\": \"-p0\",\n" +
                "                        \"paramValue\": \"1_2_1\"\n" +
                "                    }\n" +
                "                ]\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"inputs\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_3\",\n" +
                "                \"blockName\": \"03:zipzip\",\n" +
                "                \"inputName\": \"-i0\",\n" +
                "                \"frontOutput\": {\n" +
                "                    \"frontOutputName\": \"b/b_a/b_a_b.jpg\",\n" +
                "                    \"blockId\": \"uiStart_1\",\n" +
                "                    \"dataId\": \"\"\n" +
                "                }\n" +
                "            }\n" +
                "        ],\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_3\",\n" +
                "                \"blockName\": \"03:zipzip\",\n" +
                "                \"inputName\": \"-i0\",\n" +
                "                \"frontOutput\": {\n" +
                "                    \"frontOutputName\": \"b/b_a/b_a_a.jpg\",\n" +
                "                    \"blockId\": \"uiStart_1\",\n" +
                "                    \"dataId\": \"\"\n" +
                "                }\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"outputs\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_2\",\n" +
                "                \"blockName\": \"02:test5\",\n" +
                "                \"outputName\": \"o1\",\n" +
                "                \"outputAddress\": \"b/\",\n" +
                "                \"outputValue\": \".1\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_2\",\n" +
                "                \"blockName\": \"02:test5\",\n" +
                "                \"outputName\": \"o2\",\n" +
                "                \"outputAddress\": \"b/\",\n" +
                "                \"outputValue\": \".2\"\n" +
                "            }\n" +
                "        ],\n" +
                "        [\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_2\",\n" +
                "                \"blockName\": \"02:test5\",\n" +
                "                \"outputName\": \"o1\",\n" +
                "                \"outputAddress\": \"b/\",\n" +
                "                \"outputValue\": \".1\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"blockId\": \"uiAlgorithm_2\",\n" +
                "                \"blockName\": \"02:test5\",\n" +
                "                \"outputName\": \"o2\",\n" +
                "                \"outputAddress\": \"b/\",\n" +
                "                \"outputValue\": \".2\"\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"data\": [\n" +
                "        [\n" +
                "            {\n" +
                "                \"dataBlockName\": \"外部数据源1\",\n" +
                "                \"dataName\": \"+uiData_1+1\",\n" +
                "                \"dataValue\": \"b/b_a/b_a_a.jpg\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"dataBlockName\": \"外部数据源2\",\n" +
                "                \"dataName\": \"+uiData_2+1\",\n" +
                "                \"dataValue\": \"b/b_a/b_a_b.jpg\"\n" +
                "            }\n" +
                "        ],\n" +
                "        [\n" +
                "            {\n" +
                "                \"dataBlockName\": \"外部数据源1\",\n" +
                "                \"dataName\": \"+uiData_1+1\",\n" +
                "                \"dataValue\": \"b/b_a/b_a_b.jpg\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"dataBlockName\": \"外部数据源2\",\n" +
                "                \"dataName\": \"+uiData_2+1\",\n" +
                "                \"dataValue\": \"b/b_a/b_a_a.jpg\"\n" +
                "            }\n" +
                "        ]\n" +
                "    ],\n" +
                "    \"other说明\": \"优先级和并行策略\",\n" +
                "    \"other\": [\n" +
                "        {\n" +
                "            \"Priority\": \"50\",\n" +
                "            \"ParallelStrategy\": \"-ut\"\n" +
                "        }\n" +
                "    ]\n" +
                "}";
        JSONObject aaa = JSONObject.fromObject(aa);
        String result = HttpRequest.sendPost("http://localhost:8080/JCPT/ws/task/start","data="+dd);
//        String result = HttpRequest.sendPost("http://localhost:8080/JCPT/ws/task/start","data="+ee.replaceAll("\\+", "%2B"));
        System.out.println(result);
    }
}
